﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HairstyleManage.aspx.cs"
    Inherits="HairstyleManage" %>

<%@ Import Namespace="Maticsoft.Common" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../../Content/css/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet"
        type="text/css" />
    <script src="../../Content/js/jquery-1.6.2.min.js" type="text/javascript"></script>
    <script src="../../Content/js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <link href="../../Content/Style.css" rel="stylesheet" type="text/css" />
    <style>
        img
        {
            border: none;
        }
        ul, li
        {
            margin: 0;
            padding: 0;
        }
        li
        {
            list-style: none;
            float: left;
            display: inline;
            margin-right: 10px;
            border: 1px solid #AAAAAA;
        }
        
        /* tooltip */
        #tooltip
        {
            position: absolute;
            border: 1px solid #ccc;
            background: #333;
            padding: 2px;
            display: none;
            color: #fff;
        }
        .style1
        {
            width: 90px;
        }
        .style2
        {
            width: 59px;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btn_add").click(function () {
                var horizontalPadding = 30;
                var verticalPadding = 30;
                $('<iframe id="externalSite" src="HairstyleAdd.aspx" scrolling="no" />').dialog({
                    title: "添加发型",
                    autoOpen: true,
                    width: 550,
                    height: 270,
                    modal: true,
                    resizable: true,
                    autoResize: true,
                    beforeclose: function () { window.location.reload(); },
                    overlay: {
                        opacity: 0.5,
                        background: "black"
                    }
                }).width(550 - horizontalPadding).height(270 - verticalPadding);
            })
            //加载图片
            var x = 10;
            var y = 20;
            $("a.tooltip").mouseover(function (e) {
                this.myTitle = this.title;
                this.title = "";
                var imgTitle = this.myTitle ? "<br/>" + this.myTitle : "";
                var tooltip = "<div id='tooltip'><img style='width:150px;height:200px' src='" + this.href + "' alt='广告预览图'/>" + imgTitle + "<\/div>"; //创建 div 元素
                $("body").append(tooltip); //把它追加到文档中			
                $("#tooltip")
			.css({
			    "top": (e.pageY + y) + "px",
			    "left": (e.pageX + x) + "px"
			}).show("fast");   //设置x坐标和y坐标，并且显示
            }).mouseout(function () {
                this.title = this.myTitle;
                $("#tooltip").remove();  //移除 
            }).mousemove(function (e) {
                $("#tooltip")
			.css({
			    "top": (e.pageY + y) + "px",
			    "left": (e.pageX + x) + "px"
			});
            });

        })
        function edit(id) {
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $("<iframe id='externalSite' src='HairstyleAdd.aspx?id=" + id + "' scrolling='no' />").dialog({
                title: "修改发型",
                autoOpen: true,
                width: 550,
                height: 270,
                modal: true,
                resizable: true,
                autoResize: true,
                beforeclose: function () { window.location.reload(); },
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(550 - horizontalPadding).height(270 - verticalPadding);
        }
    </script>
</head>
<body>
    <form id="Form1" runat="server">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td height="30">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="15" height="30">
                            <img src="/Content/images/tab/tab_03.gif" width="15" height="30" />
                        </td>
                        <td width="1101" background="/Content/images/tab/tab_05.gif">
                            <img src="/Content/images/tab/311.gif" width="16" height="16" />
                            <span class="STYLE4">发型管理</span>
                        </td>
                        <td width="281" background="/Content/images/tab/tab_05.gif">
                            <input type="button" value="添加发型" id="btn_add" />
                        </td>
                        <td width="14">
                            <img src="/Content/images/tab/tab_07.gif" width="14" height="30" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="margin: 4px 0px 4px 0px">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="9" background="/Content/images/tab/tab_12.gif">
                            &nbsp;
                        </td>
                        <td>
                            门店:
                        </td>
                        <td>
                            <asp:DropDownList ID="drp_store" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td width="8%">
                            发型名:
                        </td>
                        <td width="8%">
                            <asp:TextBox ID="tx_movieName" runat="server"></asp:TextBox>
                        </td>
                        <td class="style2">
                            &nbsp; 类别:
                        </td>
                        <td>
                            <asp:DropDownList ID="DropDownList1" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td>
                            <asp:Button ID="btn_search" runat="server" Text="搜索" OnClick="btn_search_Click" Width="55px" />
                        </td>
                        <td width="9" background="/Content/images/tab/tab_16.gif">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="9" background="/Content/images/tab/tab_12.gif">
                            &nbsp;
                        </td>
                        <td>
                            <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td style="text-align: center">
                                        <asp:GridView ID="Grid_Barber" runat="server" AutoGenerateColumns="False" CellPadding="4"
                                            EnableModelValidation="True" ForeColor="#333333" GridLines="None" Width="100%"
                                            AllowPaging="True" OnSelectedIndexChanging="Grid_Ad_SelectedIndexChanging">
                                            <AlternatingRowStyle BackColor="White" />
                                            <RowStyle HorizontalAlign="Center" />
                                            <Columns>
                                                <asp:BoundField />
                                                <asp:BoundField DataField="id" FooterText="编号" HeaderStyle-Width="50px" HeaderText="编号" />
                                                <asp:BoundField DataField="Name" FooterText="发型名称" HeaderText="发型名称" />
                                                <asp:TemplateField HeaderText="发型类型">
                                                    <ItemTemplate>
                                                        <%#GetHairstyleTypeName((int)Eval("Type"))%>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="原图">
                                                    <ItemTemplate>
                                                        <a href="<%#ConfigHelper.GetConfigString("ImgUrl")+"hair/"+Eval("Bigimgname")%>" class="tooltip"
                                                            title="">
                                                            <%#Eval("Bigimgname") %>
                                                        </a>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <%--                                                <asp:TemplateField HeaderText="缩略图">
                                                    <ItemTemplate>
                                                        <a href="<%#ConfigHelper.GetConfigString("ImgUrl")+Eval("Smallimgname")%>" class="tooltip"
                                                            title="">
                                                            <%#Eval("Bigimgname") %></a>
                                                    </ItemTemplate>
                                                </asp:TemplateField>--%>
                                                <asp:BoundField DataField="Description" HeaderStyle-Width="200px" FooterText="描述"
                                                    HeaderText="描述" />
                                                <asp:BoundField DataField="CreateDate" FooterText="上传日期" DataFormatString="{0:yyyy-MM-dd}"
                                                    HeaderText="上传日期" />
                                                 <asp:TemplateField HeaderText="操作">
                                                    <ItemTemplate>
                                                     <%#GetStatus((int)Eval("id"))=="正常"?"<a href=\"javascript:void(0)\" onclick=\"edit("+Eval("id")+")\">修改</a> ":""%>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Pad更新状态">
                                                    <ItemTemplate>
                                                        <%#GetStatus((int)Eval("id"))%>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                            <HeaderStyle BackColor="#cae1ac" Font-Bold="True" ForeColor="White" />
                                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                                        </asp:GridView>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td width="9" background="/Content/images/tab/tab_16.gif">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td height="29">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="15" height="29">
                            <img src="/Content/images/tab/tab_20.gif" width="15" height="29" />
                        </td>
                        <td background="/Content/images/tab/tab_21.gif">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="25%" height="29" nowrap="nowrap">
                                    </td>
                                    <td width="75%" valign="top" class="STYLE1">
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td width="14">
                            <img src="/Content/images/tab/tab_22.gif" width="14" height="29" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
